<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: glBuffer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classglBuffer.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classglBuffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">glBuffer Class Reference<div class="ingroups"><a class="el" href="group__util.html">Utilities Library (jetson-utils)</a> &raquo; <a class="el" href="group__OpenGL.html">OpenGL</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>OpenGL buffer with CUDA interoperability.  
 <a href="classglBuffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="glBuffer_8h_source.html">glBuffer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa68c3df899e3305236c694d43fba29eb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#aa68c3df899e3305236c694d43fba29eb">~glBuffer</a> ()</td></tr>
<tr class="memdesc:aa68c3df899e3305236c694d43fba29eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the buffer.  <a href="#aa68c3df899e3305236c694d43fba29eb">More...</a><br /></td></tr>
<tr class="separator:aa68c3df899e3305236c694d43fba29eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f5e860c31aba728e5e52826f09ecb5f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a4f5e860c31aba728e5e52826f09ecb5f">Bind</a> ()</td></tr>
<tr class="memdesc:a4f5e860c31aba728e5e52826f09ecb5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Activate using the buffer.  <a href="#a4f5e860c31aba728e5e52826f09ecb5f">More...</a><br /></td></tr>
<tr class="separator:a4f5e860c31aba728e5e52826f09ecb5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42211a6a486c9334d8796684803ce5aa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a42211a6a486c9334d8796684803ce5aa">Unbind</a> ()</td></tr>
<tr class="memdesc:a42211a6a486c9334d8796684803ce5aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deactivate using the buffer.  <a href="#a42211a6a486c9334d8796684803ce5aa">More...</a><br /></td></tr>
<tr class="separator:a42211a6a486c9334d8796684803ce5aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfb2d3283887fe3cc4a58ee08b544251"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#abfb2d3283887fe3cc4a58ee08b544251">GetID</a> () const</td></tr>
<tr class="memdesc:abfb2d3283887fe3cc4a58ee08b544251"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the OpenGL resource handle of the buffer.  <a href="#abfb2d3283887fe3cc4a58ee08b544251">More...</a><br /></td></tr>
<tr class="separator:abfb2d3283887fe3cc4a58ee08b544251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86ea0513d06cab3172bc6c82c1a9c024"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a86ea0513d06cab3172bc6c82c1a9c024">GetType</a> () const</td></tr>
<tr class="memdesc:a86ea0513d06cab3172bc6c82c1a9c024"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the buffer type (GL_VERTEX_BUFFER or GL_INDEX_BUFFER)  <a href="#a86ea0513d06cab3172bc6c82c1a9c024">More...</a><br /></td></tr>
<tr class="separator:a86ea0513d06cab3172bc6c82c1a9c024"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a580879d597540e6775457f1fd2a5eaaf"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf">GetSize</a> () const</td></tr>
<tr class="memdesc:a580879d597540e6775457f1fd2a5eaaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the total size in bytes of the buffer.  <a href="#a580879d597540e6775457f1fd2a5eaaf">More...</a><br /></td></tr>
<tr class="separator:a580879d597540e6775457f1fd2a5eaaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a85731d95935b4da3725caa5853974e"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a3a85731d95935b4da3725caa5853974e">GetNumElements</a> () const</td></tr>
<tr class="memdesc:a3a85731d95935b4da3725caa5853974e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the number of elements (i.e.  <a href="#a3a85731d95935b4da3725caa5853974e">More...</a><br /></td></tr>
<tr class="separator:a3a85731d95935b4da3725caa5853974e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27fac07e59d2f4acb149c80e71124b7d"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a27fac07e59d2f4acb149c80e71124b7d">GetElementSize</a> () const</td></tr>
<tr class="memdesc:a27fac07e59d2f4acb149c80e71124b7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the size in bytes of each element.  <a href="#a27fac07e59d2f4acb149c80e71124b7d">More...</a><br /></td></tr>
<tr class="separator:a27fac07e59d2f4acb149c80e71124b7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6be33e8d39823bc9e231c4c6eacdff5d"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a6be33e8d39823bc9e231c4c6eacdff5d">Map</a> (uint32_t device, uint32_t flags)</td></tr>
<tr class="memdesc:a6be33e8d39823bc9e231c4c6eacdff5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map the buffer for accessing from the CPU or CUDA.  <a href="#a6be33e8d39823bc9e231c4c6eacdff5d">More...</a><br /></td></tr>
<tr class="separator:a6be33e8d39823bc9e231c4c6eacdff5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9eb0b82989ca01d884dd2d5bed3d5d44"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a9eb0b82989ca01d884dd2d5bed3d5d44">Unmap</a> ()</td></tr>
<tr class="memdesc:a9eb0b82989ca01d884dd2d5bed3d5d44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unmap the buffer from CPU/CUDA access.  <a href="#a9eb0b82989ca01d884dd2d5bed3d5d44">More...</a><br /></td></tr>
<tr class="separator:a9eb0b82989ca01d884dd2d5bed3d5d44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1c90d9ff6bf53e29ea72c721f8e36dc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#ad1c90d9ff6bf53e29ea72c721f8e36dc">Copy</a> (void *ptr, uint32_t flags)</td></tr>
<tr class="memdesc:ad1c90d9ff6bf53e29ea72c721f8e36dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy entire contents of the buffer to/from CPU or CUDA memory.  <a href="#ad1c90d9ff6bf53e29ea72c721f8e36dc">More...</a><br /></td></tr>
<tr class="separator:ad1c90d9ff6bf53e29ea72c721f8e36dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e470138ea7b8815d5b4a32a76dda2da"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a0e470138ea7b8815d5b4a32a76dda2da">Copy</a> (void *ptr, uint32_t size, uint32_t flags)</td></tr>
<tr class="memdesc:a0e470138ea7b8815d5b4a32a76dda2da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy contents of the buffer to/from CPU or CUDA memory.  <a href="#a0e470138ea7b8815d5b4a32a76dda2da">More...</a><br /></td></tr>
<tr class="separator:a0e470138ea7b8815d5b4a32a76dda2da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a0c8f682e86bbe1842eda56cf478ffb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a9a0c8f682e86bbe1842eda56cf478ffb">Copy</a> (void *ptr, uint32_t offset, uint32_t size, uint32_t flags)</td></tr>
<tr class="memdesc:a9a0c8f682e86bbe1842eda56cf478ffb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy contents of the buffer to/from CPU or CUDA memory.  <a href="#a9a0c8f682e86bbe1842eda56cf478ffb">More...</a><br /></td></tr>
<tr class="separator:a9a0c8f682e86bbe1842eda56cf478ffb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a17734482bf95e1d85c80e92072e6ac5b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classglBuffer.html">glBuffer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a17734482bf95e1d85c80e92072e6ac5b">Create</a> (uint32_t type, uint32_t size, void *data=NULL, uint32_t usage=GL_STATIC_DRAW)</td></tr>
<tr class="memdesc:a17734482bf95e1d85c80e92072e6ac5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate an OpenGL buffer.  <a href="#a17734482bf95e1d85c80e92072e6ac5b">More...</a><br /></td></tr>
<tr class="separator:a17734482bf95e1d85c80e92072e6ac5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d168857077087365422c4b5db8a3f27"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classglBuffer.html">glBuffer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglBuffer.html#a1d168857077087365422c4b5db8a3f27">Create</a> (uint32_t type, uint32_t numElements, uint32_t elementSize, void *data=NULL, uint32_t usage=GL_STATIC_DRAW)</td></tr>
<tr class="memdesc:a1d168857077087365422c4b5db8a3f27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate an OpenGL buffer.  <a href="#a1d168857077087365422c4b5db8a3f27">More...</a><br /></td></tr>
<tr class="separator:a1d168857077087365422c4b5db8a3f27"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>OpenGL buffer with CUDA interoperability. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aa68c3df899e3305236c694d43fba29eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa68c3df899e3305236c694d43fba29eb">&#9670;&nbsp;</a></span>~glBuffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">glBuffer::~glBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free the buffer. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a4f5e860c31aba728e5e52826f09ecb5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f5e860c31aba728e5e52826f09ecb5f">&#9670;&nbsp;</a></span>Bind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glBuffer::Bind </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Activate using the buffer. </p>

</div>
</div>
<a id="ad1c90d9ff6bf53e29ea72c721f8e36dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1c90d9ff6bf53e29ea72c721f8e36dc">&#9670;&nbsp;</a></span>Copy() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glBuffer::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy entire contents of the buffer to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory pointer to copy to/from, either in CPU or CUDA address space depending on flags. It's assumed that the size of the memory from this pointer is equal to <a class="el" href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf" title="Retrieve the total size in bytes of the buffer. ">GetSize()</a>, and the entire contents of the buffer will be copied.</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="a0e470138ea7b8815d5b4a32a76dda2da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e470138ea7b8815d5b4a32a76dda2da">&#9670;&nbsp;</a></span>Copy() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glBuffer::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy contents of the buffer to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory pointer to copy to/from, either in CPU or CUDA address space depending on flags.</td></tr>
    <tr><td class="paramname">size</td><td>the number of bytes to copy</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="a9a0c8f682e86bbe1842eda56cf478ffb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a0c8f682e86bbe1842eda56cf478ffb">&#9670;&nbsp;</a></span>Copy() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glBuffer::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy contents of the buffer to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory buffer to copy to/from, either in CPU or CUDA address space depending on flags</td></tr>
    <tr><td class="paramname">offset</td><td>the offset into the OpenGL buffer to copy. It is assumed any offset to the CPU/CUDA pointer argument has already been applied.</td></tr>
    <tr><td class="paramname">size</td><td>the number of bytes to copy</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="a17734482bf95e1d85c80e92072e6ac5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17734482bf95e1d85c80e92072e6ac5b">&#9670;&nbsp;</a></span>Create() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classglBuffer.html">glBuffer</a>* glBuffer::Create </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>usage</em> = <code>GL_STATIC_DRAW</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Allocate an OpenGL buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>either GL_VERTEX_BUFFER for a vertex buffer, or GL_INDEX_BUFFER for an index buffer </td></tr>
    <tr><td class="paramname">size</td><td>the size in bytes to allocated for the buffer </td></tr>
    <tr><td class="paramname">data</td><td>pointer to the initial memory of this buffer </td></tr>
    <tr><td class="paramname">usage</td><td>GL_STATIC_DRAW (never updated), GL_STREAM_DRAW (occasional updates), or GL_DYNAMIC_DRAW (per-frame updates) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a1d168857077087365422c4b5db8a3f27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d168857077087365422c4b5db8a3f27">&#9670;&nbsp;</a></span>Create() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classglBuffer.html">glBuffer</a>* glBuffer::Create </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>numElements</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>elementSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>usage</em> = <code>GL_STATIC_DRAW</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Allocate an OpenGL buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>either GL_VERTEX_BUFFER for a vertex buffer, or GL_INDEX_BUFFER for an index buffer </td></tr>
    <tr><td class="paramname">numElements</td><td>the number of elements (i.e. vertices or indices) in the buffer </td></tr>
    <tr><td class="paramname">elementSize</td><td>the size in bytes of each element </td></tr>
    <tr><td class="paramname">data</td><td>pointer to the initial memory of this buffer </td></tr>
    <tr><td class="paramname">usage</td><td>GL_STATIC_DRAW (never updated), GL_STREAM_DRAW (occasional updates), or GL_DYNAMIC_DRAW (per-frame updates) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a27fac07e59d2f4acb149c80e71124b7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27fac07e59d2f4acb149c80e71124b7d">&#9670;&nbsp;</a></span>GetElementSize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glBuffer::GetElementSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the size in bytes of each element. </p>
<dl class="section note"><dt>Note</dt><dd>if the element size wasn't specified while creating the buffer, <a class="el" href="classglBuffer.html#a27fac07e59d2f4acb149c80e71124b7d" title="Retrieve the size in bytes of each element. ">GetElementSize()</a> will be equal to 1 </dd></dl>

</div>
</div>
<a id="abfb2d3283887fe3cc4a58ee08b544251"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abfb2d3283887fe3cc4a58ee08b544251">&#9670;&nbsp;</a></span>GetID()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glBuffer::GetID </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the OpenGL resource handle of the buffer. </p>

</div>
</div>
<a id="a3a85731d95935b4da3725caa5853974e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a85731d95935b4da3725caa5853974e">&#9670;&nbsp;</a></span>GetNumElements()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glBuffer::GetNumElements </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the number of elements (i.e. </p>
<p>vertices or indices)</p>
<dl class="section note"><dt>Note</dt><dd>if the number of elements weren't specified while creating the buffer, <a class="el" href="classglBuffer.html#a3a85731d95935b4da3725caa5853974e" title="Retrieve the number of elements (i.e. ">GetNumElements()</a> will be equal to <a class="el" href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf" title="Retrieve the total size in bytes of the buffer. ">GetSize()</a> </dd></dl>

</div>
</div>
<a id="a580879d597540e6775457f1fd2a5eaaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a580879d597540e6775457f1fd2a5eaaf">&#9670;&nbsp;</a></span>GetSize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glBuffer::GetSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the total size in bytes of the buffer. </p>

</div>
</div>
<a id="a86ea0513d06cab3172bc6c82c1a9c024"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86ea0513d06cab3172bc6c82c1a9c024">&#9670;&nbsp;</a></span>GetType()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glBuffer::GetType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the buffer type (GL_VERTEX_BUFFER or GL_INDEX_BUFFER) </p>

</div>
</div>
<a id="a6be33e8d39823bc9e231c4c6eacdff5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6be33e8d39823bc9e231c4c6eacdff5d">&#9670;&nbsp;</a></span>Map()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* glBuffer::Map </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Map the buffer for accessing from the CPU or CUDA. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>either GL_MAP_CPU or GL_MAP_CUDA</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_READ_WRITE</li>
<li>GL_READ_ONLY</li>
<li>GL_WRITE_ONLY</li>
<li>GL_WRITE_DISCARD</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CPU pointer to buffer if GL_MAP_CPU was specified, CUDA device pointer to buffer if GL_MAP_CUDA was specified, or NULL if an error occurred mapping the buffer. </dd></dl>

</div>
</div>
<a id="a42211a6a486c9334d8796684803ce5aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42211a6a486c9334d8796684803ce5aa">&#9670;&nbsp;</a></span>Unbind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glBuffer::Unbind </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deactivate using the buffer. </p>

</div>
</div>
<a id="a9eb0b82989ca01d884dd2d5bed3d5d44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9eb0b82989ca01d884dd2d5bed3d5d44">&#9670;&nbsp;</a></span>Unmap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glBuffer::Unmap </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unmap the buffer from CPU/CUDA access. </p>
<dl class="section note"><dt>Note</dt><dd>the buffer will be unbound after calling <a class="el" href="classglBuffer.html#a9eb0b82989ca01d884dd2d5bed3d5d44" title="Unmap the buffer from CPU/CUDA access. ">Unmap()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jetson-utils/<a class="el" href="glBuffer_8h_source.html">glBuffer.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classglBuffer.html">glBuffer</a></li>
    <li class="footer">Generated on Tue Jul 14 2020 21:59:35 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
